#include "EchoServiceHandler.h"

void EchoServiceHandler::open()
{
  reactor_->registerHandler(this, READ_EVENT);
}

void EchoServiceHandler::service()
{
  std::string toEcho = peer().recv();
  std::cout << "Sending: " << toEcho << std::endl;
  peer().send(toEcho);
}
  
void EchoServiceHandler::handleEvent(Handle h, EventType et)
{
  service();
}




